#include <iostream>
#include <cstdio>
#include <cstring>
#define lowbit(x) (x & (-x))

using namespace std;
const int N = 32005;

int a[N], c[N];

void Update(int k)
{
    for(int i = k; i <= N; i += lowbit(i))
        c[i] += 1;
}
int GetSum(int k)
{
    int sum = 0;
    for(int i = k; i > 0; i -= lowbit(i))
        sum += c[i];
    return sum;
}
int main()
{
    int n, x;
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
    {
        scanf("%d%*d", &x);
        x++;
        a[GetSum(x)]++;
        Update(x);
    }
    for(int i = 0; i < n; i++)
        printf("%d\n", a[i]);
    return 0;
}
